<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<head>
  <link href="${pageContext.request.contextPath}/css/nav_top.css" rel="stylesheet" type="text/css"/>
	<style type="text/css">
		body{margin:0px;padding:0px;}
		.cls{clear:both;}
		a:focus{outline:none;}

		.menu{height:48px;display:block;padding:0px;width:999px;margin:40px auto 0 auto;}
		.menu ul{list-style:none;padding:0;margin:0;}
		.menu ul li{float:left;overflow:hidden;position:relative;line-height:48px;text-align:center;}
		.menu ul li a{position:relative;display:block;width:111px;height:48px;font-family:"微软雅黑", "宋体";font-size:14px;text-decoration:none;cursor:pointer;font-weight:bold;line-height:48px;}
		.menu ul li a span{position:absolute;left:0;width:111px;}
		.menu ul li a span.out{top:0px;}
		.menu ul li a span.over,  .menu ul li a span.bg{top:-48px;}
		#menu2{background-image:url(../images/s_03.jpg);background-repeat:repeat;}
		#menu2 ul li a span{color: black}
		#menu2 ul li a span.over{color:red;height:48px;width:111px;background-image:url(../images/w_03.jpg);background-repeat:repeat;}
	</style>

	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
	<script type="text/javascript">
        $(document).ready(function() {

            $("#menu2 li a").wrapInner( '<span class="out"></span>' );

            $("#menu2 li a").each(function() {
                $( '<span class="over">' +  $(this).text() + '</span>' ).appendTo( this );
            });

            $("#menu2 li a").hover(function() {
                $(".out",	this).stop().animate({'top':	'48px'},	300); // move down - hide
                $(".over",	this).stop().animate({'top':	'0px'},		300); // move down - show

            }, function() {
                $(".out",	this).stop().animate({'top':	'0px'},		300); // move up - show
                $(".over",	this).stop().animate({'top':	'-48px'},	300); // move up - hide
            });

        });
	</script>
</head>
<%String user =(String) session.getAttribute("username");%>
<div class="span10 last">
		<div class="topNav clearfix">
			<ul>
				<c:choose>
					<c:when test="<%=user==null%>">
						<li id="headerLogin" class="headerLogin" style="display: list-item;">
							<a href="${pageContext.request.contextPath}/app/user/userLoginUI">登录</a>|
						</li>
						<li id="headerRegister" class="headerRegister" style="display: list-item;">
							<a href="${pageContext.request.contextPath}/app/user/userRegisterUI">注册</a>|
						</li>
					</c:when>
					<c:otherwise>
            <li id="headerLogin" class="headerLogin" style="display: list-item;">
              <a href="${pageContext.request.contextPath}/app/user/userLoginUI"><span>欢迎</span><span style="color: red"><%=user%></span><span>登录</span></a>|
            </li>
            <li id="headerRegister" class="headerRegister" style="display: list-item;">
              <a href="${pageContext.request.contextPath}/app/user/userRegisterUI">购物车</a>|
            </li>
            <li id="headerLogin" class="headerLogin" style="display: list-item;">
              <a href="${pageContext.request.contextPath}/app/user/userLoginUI">我的订单</a>|
            </li>
            <li id="headerRegister" class="headerRegister" style="display: list-item;">
              <a href="${pageContext.request.contextPath}/app//user/removeUser">退出</a>|
            </li>
					</c:otherwise>
				</c:choose>

				<li style="display: list-item;"><a>会员中心</a>|</li>
				<li style="display: list-item;"><a>购物指南</a>|</li>
				<li style="display: list-item;"><a>关于我们</a></li>
			</ul>
		</div>

			<div class="phone">
				客服热线:
				<strong>96008/53277764</strong>
			</div>
	</div>
	<div>

		<div id="menu2" class="menu">
      <ul>
		  <li><a href="${pageContext.request.contextPath}/app/category/index">首页</a></li>
				 <c:forEach var="c" items="${list}" begin="0" end="4">
					 <li> <a  href="${pageContext.request.contextPath}/app/category/byCategory?categoryname=${c.categoryname}&start=1">${c.categoryname}</a></li>
				 </c:forEach>
			 </ul>
			<div class="cls"></div>
       </div>
	</div>

	<%--
	<input type="text" onkeyup="suggestion(this.value)"/>
	<span id="s"></span>
	--%>